package com.elh.proxy;
 
import java.lang.reflect.Proxy;
 
public class Test {
 
    public static void main(String[] agrs) {
        System.setProperty("sun.misc.ProxyGenerator.saveGeneratedFiles","true");
        HelloWordHandle helloWordHandle = new HelloWordHandle(new HelloWordImp());
        HelloWordInterface HelloWordProx = (HelloWordInterface) Proxy.newProxyInstance(Test.class.getClassLoader(), new Class[]{HelloWordInterface.class}, helloWordHandle);
        System.out.println(HelloWordProx.sayHello("carry"));
    }
}